package cn.cpf.app.comp;

import javax.swing.*;
import java.awt.*;
import java.util.Random;


public class FormItem extends JPanel {
    private JTextField tf;
    private JLabel label;

    private String field;

    static Random random = new Random(16);

    public FormItem(String label, String field, String defaultVal) {
        setVisible(true);
        setLayout(new GridLayout(1, 2));
        this.label.setText(label);
        this.field = field;
        tf.setText(defaultVal);
    }

    public FormItem() {
        this("label" + random.nextInt(12), "label" + random.nextInt(), "label" + random.nextInt());
    }

}
